package com.project.service.statisiticsService.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.SaleStatisticsBean;
import com.project.mapper.statisticsMapper.ISaleStatisticsMapper;
import com.project.service.statisiticsService.ISaleStstisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

/**
 * 销售统计实现类
 */
@Service
@Transactional
public class SaleStatisticsServiceImpl implements ISaleStstisticsService {
    @Autowired
    private ISaleStatisticsMapper mapper;

    @Override
    public PageInfo<SaleStatisticsBean> findByItem(int pageNO, String factory, LocalDate startDate, LocalDate endDate) {
        PageHelper.startPage(pageNO,PAGESIZE);
        PageInfo<SaleStatisticsBean> pageInfo = PageInfo.of(mapper.findByItem(factory,startDate,endDate));
        return pageInfo;
    }

}
